import java.util.LinkedList;


public class linkedLists {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		LinkedList one = new LinkedList<Integer>();
		LinkedList two = new LinkedList<Integer>();
		
		
		one.add("1");
		one.add("2");
		one.add("3");
		one.add("4");
		one.add("5");
		
		//System.out.println(one.get(0));
		
		
		
		for(int i = 0; i < 5; i++){
			
			two.addFirst(one.removeFirst());
			
			
		}
		
		
		for(int i=0; i<two.size(); i++){
			
			System.out.println(two.get(i));
			
		}
		

	}

}
